using System;
using System.Collections.Generic;
using System.Text;

namespace IGGCore
{
    /// <summary>
    /// A dictionary of possible indicators for a game
    /// </summary>
    public class Indicators  
    {
        private static Dictionary<string, Indicator> m_list = new Dictionary<string, Indicator>();

        public static void Initialize()
        {
            m_list.Add("F", new Indicator("F", "F", "Finalized", Indicator.IndicatorCategoy.TERMINATED));
            m_list.Add("FM", new Indicator("FM", "F", "Finalized Mercy", Indicator.IndicatorCategoy.TERMINATED));
            m_list.Add("FT", new Indicator("FT", "T", "Finalized Tied", Indicator.IndicatorCategoy.TERMINATED));
            m_list.Add("I", new Indicator("I", null, "In Progress", Indicator.IndicatorCategoy.IN_PROGRESS));
            m_list.Add("PW", new Indicator("PW", null, "Warmup", Indicator.IndicatorCategoy.WARMUP));
            m_list.Add("P", new Indicator("P", null, "Pregame", Indicator.IndicatorCategoy.WARMUP));
            m_list.Add("S", new Indicator("S", null, "Next", Indicator.IndicatorCategoy.NEXT));
            m_list.Add("O", new Indicator("O", null, "Game Over", Indicator.IndicatorCategoy.TERMINATED));
            m_list.Add("DR", new Indicator("DR", null, "Rain", Indicator.IndicatorCategoy.INTERRUPTED));
            m_list.Add("FR", new Indicator("FR", null, "Rain", Indicator.IndicatorCategoy.INTERRUPTED));
            m_list.Add("FB", new Indicator("FB", null, "Wind", Indicator.IndicatorCategoy.INTERRUPTED));
            m_list.Add("PR", new Indicator("PR", null, "Rain", Indicator.IndicatorCategoy.INTERRUPTED));
            m_list.Add("CR", new Indicator("CR", null, "Rain", Indicator.IndicatorCategoy.INTERRUPTED));
            m_list.Add("IR", new Indicator("IR", null, "Rain", Indicator.IndicatorCategoy.INTERRUPTED));
            m_list.Add("DC", new Indicator("DC", null, "Cold", Indicator.IndicatorCategoy.INTERRUPTED));
            m_list.Add("DA", new Indicator("DA", null, "Tragedy", Indicator.IndicatorCategoy.INTERRUPTED));
            m_list.Add("CG", new Indicator("CG", null, "Wet Grounds", Indicator.IndicatorCategoy.INTERRUPTED));
        }

        public static Indicator GetIndicator(string code)
        {
            if (m_list.ContainsKey(code) == false)
            {
                // ERROR
                Console.WriteLine("UNMANAGED CODE");
            }
            return m_list[code];
        }
    }
}
